package com.novabluetooth.services.servicedevices;

import java.util.UUID;

import com.health.tools.GlobalConts;
import com.novabluetooth.services.TJBluetoothLeService;
import com.novabluetooth.services.TJBluetoothLeService.LocalBinder;

import android.bluetooth.BluetoothGattService;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

/**
 * 和泰达耳温枪、额温枪
 * 
 * @author nova
 *
 */
public class TiWenHtdService extends TJBluetoothLeService {
	/**
	 * 额温枪
	 */
	public final static UUID serviceEWenUUID = UUID.fromString("0000ffe0-0000-1000-8000-00805f9b34fb");
	public final static UUID readCharactEWenUUID = UUID.fromString("0000ffe1-0000-1000-8000-00805f9b34fb");
	
	@Override
	public void servicesDiscovered() {
		super.servicesDiscovered();
		BluetoothGattService gattService = mBluetoothGatt.getService(serviceEWenUUID);
		readGattCharact = gattService.getCharacteristic(readCharactEWenUUID);
		mBluetoothGatt.setCharacteristicNotification(readGattCharact, true);
	}

	@Override
	public boolean isRightData(byte[] buffer) {
		super.isRightData(buffer);

		String string = new String(buffer);
		checkData = string;
		Log.e("额温枪数据：" , "额温枪数据：" + string+"**");
		ifSuccess = true;
		disconnect();
		return ifSuccess;
		
	}
	 

	@Override
	public void closeDevice() {
		super.closeDevice();
	}
	
	
}
